package com.dhu.stylefit.converter;

import com.dhu.stylefit.dao.Clothes;
import com.dhu.stylefit.dto.ClothesDTO;

public class ClothesConverter {

    public static ClothesDTO convertClothes(Clothes clothes) {
        ClothesDTO clothesDTO = new ClothesDTO();
        clothesDTO.setClothesId(clothes.getClothesId());
        clothesDTO.setName(clothes.getName());
        clothesDTO.setDescription(clothes.getDescription());
        clothesDTO.setImageUrl(clothes.getImageUrl());
        clothesDTO.setCategoryId(clothes.getCategory());
        clothesDTO.setUserId(clothes.getUserId());
        clothesDTO.setCreatedAt(clothes.getCreatedAt());
        return clothesDTO;
    }

    public static Clothes convertClothes(ClothesDTO clothesDTO) {
        Clothes clothes = new Clothes();
        clothes.setClothesId(clothesDTO.getClothesId());
        clothes.setName(clothesDTO.getName());
        clothes.setDescription(clothesDTO.getDescription());
        clothes.setImageUrl(clothesDTO.getImageUrl());
        clothes.setCategory(clothesDTO.getCategoryId());
        clothes.setUserId(clothesDTO.getUserId());
        clothes.setCreatedAt(clothesDTO.getCreatedAt());
        return clothes;
    }
}
